package com.cdxy.util;

import org.apache.commons.lang3.StringUtils;

import java.util.Arrays;
import java.util.List;

/**
 * @Author: tangy
 * @Date: 2020/3/6 17:28
 */
public class UidUtil {
    private static final List<String> dict = Arrays
            .asList("123456789ABCDEFGHJKLMNPQRSTUVWXY".split(""));

    /**
     * 不能修改
     * <p>
     * <p>
     * 根据9位数字生成特定的32进制字符串
     */
    public static String generateCodeByAxUid(int axUid) {
        String result = "";
        do {
            result = StringUtils.join(dict.get(axUid % 32), result);
            axUid = axUid / 32;
        } while (axUid > 0);
        return result;
    }
}
